<div data-extend-template="components/views/bst-modal.html">
  <h4 data-block="modal-header">Content Host Module Stream Management</h4>
  <div data-block="modal-body">
    <div bst-feature-flag="remote_actions">
      <h3 translate ng-hide="selectedModuleStreamOption === 'available'">Available Module Streams</h3>
    </div>

    <form id="moduleStreamActionForm" method="post" action="/katello/remote_execution">
      <input type="hidden" name="remote_action" ng-value="moduleStreamActionFormValues.remoteAction"/>
      <input type="hidden" name="module_stream_action" ng-value="moduleStreamActionFormValues.moduleStreamAction"/>
      <input type="hidden" name="module_spec" ng-value="moduleStreamActionFormValues.moduleSpec"/>
      <input type="hidden" name="bulk_host_ids" ng-value="moduleStreamActionFormValues.bulkHostIds"/>
      <input type="hidden" name="customize" ng-value="moduleStreamActionFormValues.customize"/>
      <input type="hidden" name="authenticity_token" ng-value="moduleStreamActionFormValues.authenticityToken"/>
    </form>

    <div data-extend-template="layouts/partials/table.html">

    <span data-block="no-rows-message" translate>
      There are no Module Streams to display.
    </span>

    <span data-block="no-search-results-message" translate>
      Your search returned zero Module Streams.
    </span>
    <div data-block="table">
      <table class="table table-striped table-bordered" ng-class="{'table-mask': table.working}">
        <thead>
          <tr bst-table-head>
            <th bst-table-column translate>Name</th>
            <th bst-table-column translate>Stream</th>
            <th bst-table-column translate>Actions</th>
          </tr>
        </thead>

        <tbody>
          <tr bst-table-row ng-repeat="module in table.rows">
            <td bst-table-cell>
              <a href="/module_streams?search=module_spec%3D{{ module.module_spec }}">
              {{ module.name }}</a></td>
            <td bst-table-cell>{{ module.stream }}</td>
            <td bst-table-cell>
              <div class="dropdown" ng-hide="!remoteExecutionPresent || denied('edit_hosts', host)">
                <button class="btn btn-default dropdown-toggle" ng-disabled="$scope.working" type="button" id="dropdownMenu1" data-toggle="dropdown"> Actions
                  <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                  <li role="presentation">
                    <label class="drop-down-check-box">
                      <input id="customize" name="customize" ng-model="moduleStreamActionFormValues.customize" type="checkbox"/>
                      <span translate>Customize</span>
                    </label>
                  </li>
                  <li role="presentation" class="divider"></li>

                  <li role="presentation" ng-repeat="action in moduleStreamActions"><a role="menuitem" tabindex="-1" ng-click="performViaRemoteExecution(module.module_spec, action.action)" href="#">{{ action.description}}</a></li>
                </ul>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  </div>
  <div data-block="modal-footer">
    <button class="btn btn-default" ng-click="cancel()" translate>Cancel</button>
  </div>
</div>
